package com.tang.design_pattern.ObservationPattern.actualPattern;

/**
 * @author tmh
 * @date 2024/3/23 20:53
 * @description 被观察者2号
 */
public class TwoObserver extends MyObserver{

    public TwoObserver(MySubject mySubject) {
        super.subject=mySubject;
        //把自己放入被观察者的集合里面
        subject.add(this);
    }

    @Override
    public void listen() {
        System.out.println("TwoObserver is listening!");
    }
}
